Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@turf/bearing

Package Overview
Dependencies
Maintainers
4
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@turf/bearing

turf bearing module

  • 4.7.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.5M
increased by1.79%
Maintainers
4
Weekly downloads
 
Created

What is @turf/bearing?

@turf/bearing is a module within the Turf.js library that provides geospatial analysis tools. Specifically, it calculates the bearing between two geographical points. This is useful in various applications such as navigation, mapping, and geographic information systems (GIS).

What are @turf/bearing's main functionalities?

Calculate Bearing

This feature calculates the bearing between two geographical points. The bearing is the angle between the north direction and the line connecting the two points, measured in degrees.

const turf = require('@turf/turf');

const point1 = turf.point([0, 0]);
const point2 = turf.point([10, 10]);
const bearing = turf.bearing(point1, point2);
console.log(bearing);

Calculate Bearing with Initial and Final Bearings

This feature allows you to calculate both the initial and final bearings between two points. The initial bearing is the angle at the starting point, while the final bearing is the angle at the destination point.

const turf = require('@turf/turf');

const point1 = turf.point([0, 0]);
const point2 = turf.point([10, 10]);
const initialBearing = turf.bearing(point1, point2, {final: false});
const finalBearing = turf.bearing(point1, point2, {final: true});
console.log(`Initial Bearing: ${initialBearing}, Final Bearing: ${finalBearing}`);

Other packages similar to @turf/bearing

Keywords

FAQs

Package last updated on 12 Sep 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc